package com.zx.free.controller;

import com.zx.free.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class UserDemoController {


    @GetMapping("/basic")
    public String test(Model model){
        //纯文本形式的参数
        model.addAttribute("userName","freemarker");
        //实体类相关的参数
        User user = new User();
        user.setUserName("zx");
        user.setAreaId(1);
        user.setNickName("zx001");
        model.addAttribute("user",user);
        return "basic.ftlh";
    }
}
